package com.jackson.rocketmqdemo.controller;

/*
 * Author: JacksonCoder
 * FileName: MessageController
 * Version: 1.0.0
 * Date: 2025/4/28
 */

import com.jackson.rocketmqdemo.service.Producer.MessageProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/mq")
public class MessageController {

    @Autowired
    private MessageProducer messageProducer;

    @GetMapping("/send")
    public String send(@RequestParam String message){
        messageProducer.sendMessage("dome-topic", message);
        return "Message sent: " + message;
    }

}
